(function(doc, win) {
    var docEl = doc.documentElement
    var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
    var recalc = function() {
      var clientWidth = docEl.clientWidth
  
      if (!clientWidth) return
  
      var html = document.getElementsByTagName('html')[0]
      var oWidth = document.body.clientWidth || document.documentElement.clientWidth
      // 根据设计图等比还原，原型图px就是要写的px
      html.style.fontSize = oWidth / 1280 * 100 + 'px'
    }
  
    if (!doc.addEventListener) return
  
    win.addEventListener(resizeEvt, recalc, false) 
  
    doc.addEventListener('DOMContentLoaded', recalc, false)
  })(document, window)
  
  